#include "bits/stdc++.h"

using namespace std;

class Solution {
public:
    int visiblePoints(vector<vector<int>>& points, int angle, vector<int>& location) {
        int ans = 0;
        vector<double> list1;
        int count = 0;
        for(const auto& point:points){
            if(point[0] == location[0] && point[1] == location[1]){
                count++;
                continue;
            }
            if(point[0] == location[0]){
                if(point[1] > location[1]){
                    list1.push_back(90.0);
                }else{
                    list1.push_back(-90.0 + 360.0);
                }
            }else{
                double x = 1.0 * (point[0] - location[0]);
                double y = 1.0 * (point[1] - location[1]);
                double tmp = 180 * atan2(y,x) / M_PI;
                if(tmp<0){
                    tmp+=360;
                }
                list1.push_back(tmp);
            }
        }
        sort(list1.begin(),list1.end());
        int left = 0;
        int right = 0;
        int n = list1.size();
        for(int i=0;i<n;i++){
            list1.push_back(list1[i] + 360);
        }
        while(right<list1.size()){
            while(list1[right]-list1[left] > angle){
                left++;
            }
            ans = max(ans,right-left+1);
            right++;
        }
        return ans + count;
    }
};